#include "workermenu.h"
#include "ui_workermenu.h"
#include "storemoney.h"
#include "customerinfo.h"
#include "drawmoney.h"
workermenu::workermenu(QWidget *parent, login *lg, std::string name) :
        QWidget(parent),workername(name),
        ui(new Ui::workermenu)
{
        lg->close();
        ui->setupUi(this);
        ui->label_worker->setText(QString::fromStdString("工作人员:"+workername));
        connect(ui->pushButton_drawmoney,SIGNAL(clicked()),
                this, SLOT(handleDrawmoney()));
        connect(ui->pushButton_openaccount, SIGNAL(clicked()),
                this, SLOT(handleOpenaccount()));
        connect(ui->pushButton_storemoney, SIGNAL(clicked()),
                this, SLOT(handleStoremoney()));
}

workermenu::~workermenu()
{
        delete ui;
}

void workermenu::handleStoremoney(){
        storemoney *st = new storemoney(0, workername);
         st->show();
}

void workermenu::handleDrawmoney() {
        drawmoney *dr = new drawmoney(0, workername);
        dr->show();
}

void workermenu::handleOpenaccount() {
        customerinfo *cs = new customerinfo(0, workername);
        cs->show();
}
